//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.atjg.autocat.sql;

import android.util.Log;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SqlExecutor implements Executor {
    public static final SqlExecutor Instance = new SqlExecutor();
    ExecutorService executor = Executors.newFixedThreadPool(1, Executors.defaultThreadFactory());

    private SqlExecutor() {
    }

    public void execute(Runnable command) {
        this.executor.execute(command);
    }

    public abstract static class SqlRunnable<T> {
        public SqlRunnable() {
        }

        public abstract T run();

        public final void asyncRun(final Callback<T> callback) {
            SqlExecutor.Instance.execute(new Runnable() {
                public void run() {
                    Log.d("SqlRunnable", "run" + Thread.currentThread() + Thread.currentThread().getId());
                    callback.onFinish(SqlRunnable.this.run());
                }
            });
        }
    }

    public interface Callback<T> {
        void onFinish(T var1);
    }
}
